//
//  HeaderCollectionReusableView.m
//  NEWS_W_Y_S
//
//  Created by lanou3g on 15/10/15.
//  Copyright © 2015年 lanou3g.jake. All rights reserved.
//

#import "HeaderCollectionReusableView.h"
#import "RadioModel.h"


@implementation HeaderCollectionReusableView


-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        [self layoutViews];
    }
    
    return self;
}
-(void)layoutViews{
    
    //电台分类的点击
    self.button = [UIButton buttonWithType:UIButtonTypeCustom];
    self.button.frame = CGRectMake(0, 5, self.frame.size.width, 40);
    [self addSubview:self.button];
    
    //电台的分类名字
    self.headerName = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, 80, 35)];
    [self.button addSubview:self.headerName];
    
    //分类右边的点击
    self.imageView  = [[UIImageView alloc] initWithFrame:CGRectMake(350, 10, 20, 20)];
    self.imageView.image = [UIImage imageNamed:@"qianjin"];
    [self.button addSubview:self.imageView];
    
    //分类之间的分割线
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, self.frame.size.width - 10, 4)];
    label.backgroundColor = [UIColor colorWithWhite:0.828 alpha:1];
    [self.button addSubview:label];
    
}

-(void)headerData:(RadioModel *)radioModel
{
    self.headerName.text = radioModel.cname;//获取电台分类名
}


@end
